package com.example.pagingdemo.model;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.Objects;

/**
 * @author: tuyrt7 on 2020/9/9.
 */
public class Movie {
    public int id;
    public String title;
    public String year;
    public Images images;

    public class Images {
        public String large;

        @Override
        public boolean equals(Object obj) {
            if (obj == null || !(obj instanceof Images)) {
                return false;
            }
            Images newObj = (Images) obj;
            return large.equals(newObj.large);
        }

        @Override
        public String toString() {
            return "Images{" +
                    "large='" + large + '\'' +
                    '}';
        }
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || !(obj instanceof Movie)) {
            return false;
        }
        Movie newObj = (Movie) obj;
        return id == newObj.id
                && title.equals(newObj.title)
                && year.equals(newObj.year)
                && images.equals(newObj.year);
    }

    @Override
    public String toString() {
        return "Movie{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", year='" + year + '\'' +
                ", images=" + images +
                '}';
    }
}
